goog.provide('czk.ui.tab.Tabpanels');

goog.require('goog.dom');
goog.require('goog.dom.TagName');

goog.require('czk.ui.ZKComponent');

/**
 * @constructor
 * @extends {czk.ui.ZKComponent}
 */
czk.ui.tab.Tabpanels = function() {
  goog.base(this);
};
goog.inherits(czk.ui.tab.Tabpanels, czk.ui.ZKComponent);

czk.ui.tab.Tabpanels.prototype.createDom = function() {
  var dh = this.getDomHelper();
  var el = dh.createDom(goog.dom.TagName.DIV, {
    'className': 'page'
  });

  this.setElementInternal(el);

  this.getParent().tabPanels = this;
};

czk.ui.tab.Tabpanels.prototype.select = function(index) {
  this.forEachChild(function(child, i) {
    if (index == i)
      child.show();
    else
      child.hide();
  }, this);
};

czk.ui.tab.Tabpanels.create = function() {
  return new czk.ui.tab.Tabpanels();
};
